#ifndef GAMEHALL_H
#define GAMEHALL_H
#include <vector>
#include <QListWidget>
#include <QWidget>
#include "./socket/sockclient.h"
#include "setpasswordwid.h"

namespace Ui {
class GameHall;
}

class GameHall : public QWidget
{
    Q_OBJECT

public:
    explicit GameHall(QWidget *parent = 0);
    ~GameHall();
    void setSocket(shared_ptr<SockClient> socket);
    void getDetailHomeInfo(QByteArray byte);
private slots:
    void on_hall_list_widget_itemDoubleClicked(QListWidgetItem *item);
    void on_create_home_butt_clicked();
    void on_join_home_butt_clicked();
    void on_flash_butt_clicked();
private:
    void CreateSeatSuccess();
    void CreateSeatFail();
    void joinSuccess();
    void joinFail(QByteArray info);
signals:
    void signal_CreateSeatSuccess();
    void signal_CreateSeatFail();
    void signal_FlashHome(std::vector<std::pair<string,string>> vec);
    void signal_JoinSuccess();
    void signal_JoinFail(QByteArray info);
    void signal_NetGameStart();
private:
    void flashHome(std::vector<std::pair<string,string>> vec);
private:
    Ui::GameHall *ui;
    shared_ptr<SockClient> m_cli;
    SetPasswordWid         m_psw_wid;
};

#endif // GAMEHALL_H
